package com.siashan.unipay4j.core.pay;

import com.siashan.unipay4j.core.TradeStateEnum;
import lombok.Data;

import java.math.BigDecimal;

/**
 * 回调结果
 *
 * @author  siashan
 * @since  v1.0.1
 **/
@Data
public class PayResponse {

    /**
     * 支付结果
     */
    private TradeStateEnum tradeState;

    /**
     * 支付结果描述
     */
    private String tradeStateDesc;

    /**
     * 平台订单号
     */
    private String outTradeNo;

    /**
     * 通道订单号
     */
    private String tradeNo;

    /**
     * 订单支付金额
     */
    private BigDecimal totalAmount;

    /**
     * 通道返回报文
     */
    private Object  body;


    /**
     * 交易成功
     *
     * @return  支付结果
     */
    public static PayResponse tradeSuccess() {
        PayResponse payResponse = new PayResponse();
        payResponse.setTradeState(TradeStateEnum.SUCCESS);
        payResponse.setTradeStateDesc("支付成功");
        return payResponse;
    }

}
